<script type="text/javascript" src="/js/our_js/text_edit.js"></script>
<script type="text/javascript" src="/js/our_js/generateadv.js"></script>

<div class="titleArea">    	
    <div class="wrapper">
        <form action="index.html" id="validate" class="form">
            <table style="text-align:left; width: 100%;">
                <tbody>
		    <tr>		
		      <td>
                        <div class="formRow" style="width: 550px; float:left; border-top-style: none; border-bottom-style: none; padding-right: 0px; padding-left: 0px;">
                                <label>Для генерации выберите тип рекламы:</label>
                                <div class="formRight" style="width: 200px; float:left; margin-right: 0px; margin-left: 18px;">
                                    <select name="select2" id="select2" >                                        
                                        <?php
                                        foreach ($this->types as $val) {
                                            echo '<option value="'.$val['id'].'">'.$val['type'].'</option>';
                                        }
                                        ?>
                                    </select>           
                                </div>             
                        </div>
		      <td>			
                        <div class="formRow" style="width: 480px; float:right; border-top-style: none; border-bottom-style: none; padding-left: 0px;">
                            <label>И один из своих зарегистрированных сайтов:</label>
                            <div class="formRight" style="width: 200px; float:left; margin-right: 0px; margin-left: 18px;">
                                <select name="select3" id="select3">                                    
                                    <?php
                                    foreach ($this->sites as $site) {
                                        echo '<option value="'.$site['id'].'">'.$site['url'].'</option>';
                                    }
                                    ?>
                                </select>           
                            </div>
                        </div>
                      </td>
	            </tr>
		</tbody>
	    </table>
        </form>
		
		<div class="clear"></div>
                
                
            
		
		<form action="" class="form" id="banner1">
            <div class="widget">
                    <div class="title"><img src="/images/icons/dark/record.png" alt="" class="titleIcon" /><h6>Баннерная форма</h6></div>
				
				<table style="text-align:left; width: 100%;">
				<tbody>
				<tr>
		
				<td>
				<div class="formRow" style="width: 360px; float:left; border-top-style: none; border-bottom-style: none;">
                        <label>Страница размещения:</label>
                        <div class="formRight" style="width: 190px; float:left; margin-right: 0px; margin-left: 18px;"><input type="text" class="validate[required]" name="req" id="req"/></div>
						<div class="clear"></div>
				</div>
				</td>
				
				<td>
				<div class="formRow" style="width: 250px; float:right; border-top-style: none; border-bottom-style: none; padding-left: 0px;">
                        <label>Длина очереди:</label>
                        <div class="formRight" style="width: 130px; float:left; margin-right: 0px; margin-left: 18px;">
                            <input type="text" id="sDec" value="10" /> 
                        </div>
				</div>
				</td>
				
				<td>
				<div class="formRow" style="width: 320px; float:right; border-top-style: none; border-bottom-style: none; padding-left: 0px; margin-right: 30px;">
                        <label>Размер баннера:</label>
                        <div class="formRight" style="width: 200px; float:left; margin-right: 0px; margin-left: 18px;">
                            <select name="select2" >
                                <option value="opt1">сайт1</option>
                                <option value="opt2">сайт2</option>
                                <option value="opt3">сайт3</option>
                                <option value="opt4">сайт4</option>
                                <option value="opt5">сайт5</option>
                                <option value="opt6">сайт6</option>
                                <option value="opt7">сайт7</option>
                                <option value="opt8">сайт8</option>
                            </select>           
                        </div>
				</div>
				</td>
				
				</tr>
		</tbody>
		</table>
		
				<div class="formRow" style="float:left; border-top-style: none; border-bottom-style: none;">
                        <label>Типы баннеров:</label>
                        <div class="formRight" style="width: 400px; float:left; margin-right: 0px; margin-left: 18px;">
				<input type="checkbox" checked="checked" name="check1" id="check1" /><label for="check1">.gif</label>
				<input type="checkbox" checked="checked" name="check2" id="check2" /><label for="check2">.jpg</label>
				<input type="checkbox" checked="checked" name="check3" id="check3" /><label for="check3">.png</label>
				<input type="checkbox" checked="checked" name="check4" id="check4" /><label for="check4">.swf</label>
						</div>
				</div>
				
				<div class="loginControl" style="width: 160px; float:right;">
				<input type="button" id="submit_banner" value="Сгенерировать код" class="greenB" />
				 <div class="clear"></div>
                </div>
				
				<div class="clear"></div>

				</div>
            
        </form>
		
		<form action="" class="form" id="context1">
		<div class="widget">
                    <div class="title"><img src="/images/icons/dark/record.png" alt="" class="titleIcon" /><h6>Контекстная форма</h6></div>
				
				<table style="text-align:left; width: 100%;">
				<tbody>
				<tr>
		
				<td>
				<div class="formRow" style="width: 250px; float:right; border-top-style: none; border-bottom-style: none; padding-left: 0px;">
                        <label>Ширина: </label>
                        <div class="formRight" style="width: 130px; float:left; margin-right: 0px; margin-left: 0px;">
                            <input type="text" id="sDec1" value="10" /> 
                        </div>
				</div>
				</td>
				
				<td>
				<div class="formRow" style="width: 250px; float:right; border-top-style: none; border-bottom-style: none; padding-left: 0px;">
                        <label>Высота: </label>
                        <div class="formRight" style="width: 130px; float:left; margin-right: 0px; margin-left: 0px;">
                            <input type="text" id="sDec2" value="10" /> 
                        </div>
				</div>
				</td>
				
				</tr>
		</tbody>
		</table>
        </div>
                    
                    <div class="widget">
                    <div class="title"><img src="/images/icons/dark/record.png" alt="" class="titleIcon" /><h6>Контекстная форма</h6></div>
				
				<table style="text-align:left; width: 100%;">
				<tbody>
				<tr>
		
				<td>
                                    <div class="formRight" style="width: 900px; float:left; margin-right: 0px; margin-left: 18px; padding: 5px; padding-bottom: 10px;">
                                <input type="checkbox"  name="check1" id="check_B" /><label style="margin-left: 5px; font-weight: bold;" for="check1">B</label>
				<input type="checkbox"  name="check2" id="check_I" /><label style="margin-left: 5px; font-style: italic;" for="check2">I</label>
				<input type="checkbox"  name="check3" id="check_U" /><label style="margin-left: 5px; text-decoration: underline;" for="check3">U</label> 
                                
                            <select name="select_font" id="select_font">
                                <option value="none">none</option>
                                <option value="sans-serif">sans-serif</option>
                                <option value="Arial, sans-serif">Arial, sans-serif</option>
                                <option value="Helvetica, sans-serif">Helvetica, sans-serif</option>
                                <option value="serif">serif</option>
                                <option value="Times, serif">Times, serif</option>
                                <option value="Times New Roman, serif">Times New Roman, serif</option>
                            </select>
                              
                            <select  name="select_size" id="select_size">
                                <option value="8">8</option>
                                <option value="9">9</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>                                
                                <option value="14">14</option>
                                <option value="16">16</option>
                                <option value="18">18</option>
                                <option value="20">20</option>
                                <option value="22">22</option>
                                <option value="24">24</option>
                            </select>
                                    
                               
                                <div style="float: left; margin-left: 15px;" class="cPicker" id="cPicker"><div style="background-color: #e62e90"></div><label style="float: left; margin-left: 25px;">Choose font color...</label></div>
                                <div style="float: left; margin-left: 5px;" class="cPicker" id="cPickerBg"><div style="background-color: #C3D5EA"></div><label style="float: left; margin-left: 25px;">Choose bgcolor...</label></div>
                                
                                
                                <input type="hidden" id="hex" class="cPicker" value="000000" style="width: 50px" />
                                <input type="hidden" id="hexBg" class="cPicker" value="ffffff" style="width: 50px" />
                                
                                
                               
                                
                                    </div>
			
                                    
				</td>
				
				<td>
				<div class="formRow" style="width: 250px; float:right; border-top-style: none; border-bottom-style: none; padding-left: 0px;">
                         
                         <input type="button" id="preview" onclick="preview_text()" value="Preview" class="greenB" />
				</div>
				</td>
				
				</tr>
                        <tr>
                            <td>
                                <div class="formRight" style="width: 800px; float:left; margin-right: 0px; margin-left: 18px; padding: 5px; padding-bottom: 10px;">
                                    <div id="res_txt"><span id="res_txt">Здесь будет текст банера</span></div>
                                </div>
                            </td>
                        </tr>
		</tbody>
		</table>
        </div>
                    
                    
		
			
			
				<div class="loginControl" style="width: 160px; float:right;">
				<input type="button" id="submit_context" onclick="generateadv_context()" value="Сгенерировать код" class="greenB" />
				 <div class="clear"></div>
                </div>
				
				
				<div class="clear"></div>
				
				</form>
				
				                <div class="widget">
                    <div id="test" class="title"><img src="/images/icons/dark/link2.png" alt="" class="titleIcon" /><h6>Код рекламного места</h6></div>
                    <code class="showCodeJSS"></code>
    
                </div>
		
		</div>
    
    <script>
        //выбор категории
        $('#banner1').show();
        $('#context1').hide();
        $('#select2').change(function(){
            if ($('#select2').val() == 1) {
                $('#context1').hide();
                $('#banner1').show();
            } else if ($('#select2').val() == 2) {
                $('#context1').show();
                $('#banner1').hide();
            }
        });
               
    </script>